﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace text.Tree
{
    public class _226
    {
        public TreeNode node;
        public _226()
        {
            node = new TreeNode(0);
        }
        public TreeNode InvertTree(TreeNode root)
        {
            if (root==null)
            {
                return null;
            }
            TreeNode left = InvertTree(root.left);
            TreeNode right = InvertTree(root.right);
            root.left = right;
            root.right = left;
            return root;
        }
    }
}
